package pojo;

import java.util.Date;
import java.util.Objects;

public class Student {
    private int stuId;
    private String stuName;
    private String sex;
    private Date birthday;
    private String stuTel;
    private int classId;
    private int roomId;
    private int bedId;

    public Student() {
        roomId = -1;
        bedId = -1;
    }

    public Student(int stuId, String stuName, String sex, Date birthday, String stuTel, int classId) {
        this.stuId = stuId;
        this.stuName = stuName;
        this.sex = sex;
        this.birthday = birthday;
        this.stuTel = stuTel;
        this.classId = classId;
        roomId = -1;
        bedId = -1;
    }

    public Student(int stuId, String stuName, String sex, Date birthday, String stuTel, int classId, int roomId, int bedId) {
        this.stuId = stuId;
        this.stuName = stuName;
        this.sex = sex;
        this.birthday = birthday;
        this.stuTel = stuTel;
        this.classId = classId;
        this.roomId = roomId;
        this.bedId = bedId;
    }

    public int getStuId() {
        return stuId;
    }

    public void setStuId(int stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getStuTel() {
        return stuTel;
    }

    public void setStuTel(String stuTel) {
        this.stuTel = stuTel;
    }

    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    public int getRoomId() {
        return roomId;
    }

    public void setRoomId(int roomId) {
        this.roomId = roomId;
    }

    public int getBedId() {
        return bedId;
    }

    public void setBedId(int bedId) {
        this.bedId = bedId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(stuId, student.stuId) &&
                Objects.equals(stuName, student.stuName) &&
                Objects.equals(sex, student.sex) &&
                Objects.equals(birthday, student.birthday) &&
                Objects.equals(stuTel, student.stuTel) &&
                Objects.equals(classId, student.classId) &&
                Objects.equals(roomId, student.roomId) &&
                Objects.equals(bedId, student.bedId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stuId, stuName, sex, birthday, stuTel, classId, roomId, bedId);
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuId=" + stuId +
                ", stuName='" + stuName + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday=" + birthday +
                ", stuTel='" + stuTel + '\'' +
                ", classId=" + classId +
                '}';
    }
}
